import request from '@/utils/request'

/** 获取字典列表 */
export function list(query) {
  return request({
    url: '/system/dict/type/',
    method: 'get',
    params: query
  })
}

/** 获取字典信息 */
export function getType(query) {
  return request({
    url: '/system/dict/type/' + query,
    method: 'get',
    params: query
  })
}

/** 修改字典类型 */
export function editDict(data) {
  return request({
    url: '/system/dict/type/',
    method: "put",
    data: data
  })
}

/** 添加字典类型 */
export function addDict(data) {
  return request({
    url: '/system/dict/type/',
    method: "post",
    data: data
  })
}

/** 删除字典类型信息 */
export function delType(data) {
  return request({
    url: '/system/dict/type/' + data,
    method: 'delete'
  })
}

/**
 * 刷新字典缓存
 * @returns {*}
 */
export function refreshCache() {
  return request({
    url: '/system/dict/type/refreshCache',
    method: 'delete'
  })
}
